package com.yuwubao.hz_International.entities.repository

import com.yuwubao.hz_International.entities.StoreCollection
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.jpa.repository.JpaSpecificationExecutor
import org.springframework.data.jpa.repository.Query
import java.math.BigDecimal

interface StoreCollectionRepo : JpaRepository<StoreCollection, Int>, JpaSpecificationExecutor<StoreCollection> {
    @Query(nativeQuery = true, value = "SELECT ifnull(sum(money), 0)from store_collection WHERE storeId =?1")
    fun findTotalMoney(userId: Int): BigDecimal
}